﻿#region Using Directives

    using System;

    using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Core
{
    /// <summary>
    /// This class represents an AuditUserLogin object of the system.  
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.AuditUserLoginFactory, MarketPulse.DataAccess.Factory")]
    public class AuditUserLogin : MarketPulseBase<AuditUserLogin>
    {
        #region Contructor(s)

            /// <summary>
            /// default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private AuditUserLogin()
            {
            }

        #endregion

        #region Factory Methods

            /// <summary>
            /// Method that creates a new AuditUserLogin instance via the DataPortal client proxy
            /// </summary>
            /// <returns>The newly created AuditUserLogin object</returns>
            public static AuditUserLogin New()
            {
                return DataPortal.Create<AuditUserLogin>();
            }

        #endregion

        #region Properties

            #region Association GUID Properties (Foreign Keys)

                /// <summary>The GUID of the AuditUserLoginResult object associated with this object.</summary>
                public static PropertyInfo<Guid> AuditUserLoginResultGUIDProperty = RegisterProperty<Guid>(p => p.AuditUserLoginResultGUID, string.Empty);
                /// <summary>The GUID of the AuditUserLoginResult object associated with this object.</summary>
                public Guid AuditUserLoginResultGUID
                {
                    get { return GetProperty(AuditUserLoginResultGUIDProperty); }
                    set { SetProperty(AuditUserLoginResultGUIDProperty, value); }
                }

                /// <summary>The GUID of the user attempting the system login being audited.</summary>
                public static PropertyInfo<Guid?> UserGUIDProperty = RegisterProperty<Guid?>(p => p.UserGUID);
                /// <summary>The GUID of the user attempting the system login being audited.</summary>
                public Guid? UserGUID
                {
                    get { return GetProperty(UserGUIDProperty); }
                    set { SetProperty(UserGUIDProperty, value); }
                }

                /// <summary>The GUID of the profile type of the system for the login attempt.</summary>
                public static PropertyInfo<Guid> ProfileTypeGUIDProperty = RegisterProperty<Guid>(p => p.ProfileTypeGUID);
                /// <summary>The GUID of the profile type of the system for the login attempt.</summary>
                public Guid ProfileTypeGUID
                {
                    get { return GetProperty(ProfileTypeGUIDProperty); }
                    set { SetProperty(ProfileTypeGUIDProperty, value); }
                }

            #endregion

            /// <summary>The username for the user attempting the system login being audited.</summary>
            public static PropertyInfo<string> UsernameProperty = RegisterProperty<string>(p => p.Username);
            /// <summary>The username for the user attempting the system login being audited.</summary>
            public string Username
            {
                get { return GetProperty(UsernameProperty); }
                set { SetProperty(UsernameProperty, value); }
            }

            /// <summary>The IPAddress of the machine used in the login attempt being audited.</summary>
            public static PropertyInfo<string> IPAddressProperty = RegisterProperty<string>(p => p.IPAddress);
            /// <summary>The IPAddress of the machine used in the login attempt being audited.</summary>
            public string IPAddress
            {
                get { return GetProperty(IPAddressProperty); }
                set { SetProperty(IPAddressProperty, value); }
            }

        #endregion

    }
}